home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
tpapi.exe
/
EXAMPLES
/
CAPLPT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-01-14
|
3KB
|
80 lines
{***************************************************************************}
{** Program : CAPLPT **}
{***************************************************************************}
{** Version : 1.0 ** Started : ** Ended : **}
{***************************************************************************}
{******************************** Description ******************************}
{***************************************************************************}
{** This will redirect LPT1 port to the first available print **}
{** queue on the default file server. Anything that is then written to **}
{** LPT1 is redirected to the print queue on the server. **}
{** **}
{** For direct printing to a print queue see CAPQUEUE. **}
{** **}
{** **}
{** **}
{***************************************************************************}
{******************************** Information ******************************}
{***************************************************************************}
{** **}
{** **}
{** **}
{** **}
{***************************************************************************}
{$X+}
program CAPLPT;
uses
nwvar,
nwerror,
nwbindry,
nwprint,
nwwrkstn,
nwmisc,
objects,
printer;
var
Bindery : BinderyOBJ;
Print : PrintOBJ;
WorkStat : WorkStationOBJ;
Misc : MiscFuncOBJ;
CapFlags : Capture_Flags;
QueueID : OT_BinderyID;
Queues : PStringCollection;
NoOfQueues : word;
begin
Bindery.Init (true);
Print.Init (true);
WorkStat.Init (true);
Misc.Init (true);
Queues := new (PStringCollection, Init (5, 10));
Misc.GetAllObjects ('*', OT_PrintQueue, Queues, NoOfQueues);
Bindery.GetBinderyObjectID (PString (Queues^.At (0))^, OT_PrintQueue, QueueID);
Print.GetDefaultCaptureFlags (CapFlags);
Print.SetCapturePrintQueue (0, WorkStat.GetDefaultConnectionID, QueueID);
Print.StartLPTCapture;
{do all your printing to lpt1 here}
rewrite (LST);
writeln (LST, 'THIS IS A TEST');
Print.EndLPTCapture;
close (LST);
dispose (Queues, Done);
Bindery.Done;
Misc.Done;
Print.Done;
WorkStat.Done;
end.